<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="icon" type="image/ico" th:href="@{/images/favicon.ico}">
	<link rel="stylesheet" type="text/css" th:href="@{/layui/css/layui.css}">
	<link rel="stylesheet" type="text/css" th:href="@{/css/index.css}">
	<link rel="stylesheet" type="text/css" th:href="@{/css/zTreeStyle/zTreeStyle.css}">
</head>
<body class="layui-tab-content">
<div class="layui-card layui-card-body">
	<div class="layui-form toolbar" id="queryTools">
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">角色名称</label>
				<div class="layui-input-inline">
					<input type="text" class="layui-input" id="queryName">
				</div>
			</div>
			<button class="layui-btn" id="renderTable">查询</button>
			<button class="layui-btn" id="resetSearch">重置</button>
			<button class="layui-btn" id="addNew">新增</button>
		</div>
	</div>
	<table class="layui-hide" id="roleTable" lay-filter="roleFilter"></table>
</div>

<form id="roleForm" class="layui-form" lay-filter="roleForm" style="display:none;padding-top:10px">
	<input type="hidden" name="roleId">
	<div class="layui-form-item">
		<label class="layui-form-label"><i class="layui-tip-required">*</i>角色名称</label>
		<div class="layui-input-block" style="width: 60%;">
			<input type="text" name="roleName" lay-verify="required|roleName" placeholder="请输入角色名称" autocomplete="off"
				   class="layui-input layui-form-danger">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">角色描述</label>
		<div class="layui-input-block" style="width: 60%;">
			<textarea name="roleDescribe"  autocomplete="off" lay-verify="roleDescribe" placeholder="请输入内容"  class="layui-textarea"></textarea>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">角色状态</label>
		<div class="layui-input-block">
			<input type="radio" name="status" value="1" title="启用">
			<input type="radio" name="status" value="2" title="禁用">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label"><i class="layui-tip-required">*</i>角色权限</label>
		<div class="layui-input-block"><ul id="menuTree" class="ztree"></ul></div>
	</div>
	<div class="layui-form-item layui-hide">
		<button id="saveRole" class="layui-btn" lay-submit lay-filter="editRole">保存</button>
	</div>
</form>
<script type="text/javascript" th:src="@{/js/plugins/jquery-1.11.3.min.js}"></script>
<script type="text/javascript" th:src="@{/layui/layui.js}"></script>
<script type="text/javascript" th:src="@{/js/plugins/jquery.ztree.all.min.js}"></script>
<script type="text/javascript" th:src="@{/js/sys/roleManage/listPage.js}"></script>
<script type="text/html" id="tableToolbar">
	<div class="layui-btn-container">
		<!--<button class="layui-btn layui-btn-warm" lay-event="disable">禁用选中</button>-->
		<!--<button class="layui-btn layui-btn-normal" lay-event="enable">启用选中</button>-->
	</div>
</script>
<script type="text/html" id="actionTool">
	{{# if(d.roleId != 1){ }}
		<a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
		{{# if(d.status == 1){ }}
		<a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="disable">禁用</a>
		{{# } else { }}
		<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="enable">启用</a>
		{{# } }}
	{{# }  else{ }}
		不可操作
	{{# }   }}
</script>
</body>
</html>